# tmux.conf v0.1.0
# tmux envirment custom config file for me and yours
# Copyright by calvin 2021

# set -g default-terminal "xterm-256color"
set -g default-terminal "linux"
set -g display-time 3000

set -g base-index 1
set -g pane-base-index 1

set -g prefix C-a
unbind C-b
bind C-a send-prefix

# unbind '"'
# bind - splitw -v -c '#{pane_current_path}'
# unbind %
# bind | splitw -h -c '#{pane_current_path}'

# select pane
# bind k selectp -U # above (prefix k)
# bind j selectp -D # below (prefix j)
# bind h selectp -L # left (prefix h)
# bind l selectp -R # right (prefix l)
 
# resize pane
# bind -r ^k resizep -U 10 # upward (prefix Ctrl+k)
# bind -r ^j resizep -D 10 # downward (prefix Ctrl+j)
# bind -r ^h resizep -L 10 # to the left (prefix Ctrl+h)
# bind -r ^l resizep -R 10 # to the right (prefix Ctrl+l)

# switch window
bind -n F1 select-window -t 1
bind -n F2 select-window -t 2
bind -n F3 select-window -t 3
bind -n F4 select-window -t 4
bind -n F5 select-window -t 5
bind -n F6 select-window -t 6
bind -n F7 select-window -t 7
bind -n F8 select-window -t 8
bind -n F9 select-window -t 9
bind -n F10 select-window -t 10
bind -n F11 last-window
bind -n F12 choose-window

bind -n C-1 select-window -t 1
bind -n C-2 select-window -t 2
bind -n C-3 select-window -t 3
bind -n C-4 select-window -t 4
bind -n C-5 select-window -t 5
bind -n C-6 select-window -t 6
bind -n C-7 select-window -t 7
bind -n C-8 select-window -t 8
bind -n C-9 select-window -t 9
bind -n C-0 select-window -t 10
bind -n C-- last-window
bind -n C-= choose-window

bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
bind -n M-0 select-window -t 10
bind -n M-- last-window
bind -n M-= choose-window

setw -g status-position top
setw -g status-bg white
setw -g status-fg black
setw -g status-attr none

setw -g status-interval 0

setw -g status-left "[#{session_name}]"
setw -g status-left-bg white
setw -g status-left-fg red
setw -g status-left-attr none

# setw -g window-status-format " #I:#(ps -q $$ -f | tail -n -1 | awk '{print $3}' | xargs -I{} ps -q {} -o cmd | tail -n -1) "
# setw -g window-status-format " #I:#(ps -q $$ -o ppid | tail -n -1 | xargs -I{} ps -q {} -o cmd | tail -n -1) "
# setw -g window-status-format " #I:#(ps -q $$ -o cmd | tail -n -1) "
# setw -g window-status-format " #I:#(ps --ppid $$ -o cmd | tail -n -3) "
# setw -g window-status-format " #I:#{pane_current_path}:#{pane_current_command} "
setw -g window-status-format " #I:#{pane_current_command} "
setw -g window-status-separator "|"
# setw -g window-status-current-format " #I:#(ps -q $$ -f | tail -n -1 | awk '{print $3}' | xargs -I{} ps -q {} -o cmd | tail -n -1) "
# setw -g window-status-current-format " #I:#(ps -q $$ -o ppid | tail -n -1 | xargs -I{} ps -q {} -o cmd | tail -n -1) "
# setw -g window-status-current-format " #I:#(ps -q $$ -o cmd | tail -n -1) "
# setw -g window-status-current-format " #I:#(ps --ppid $$ -o cmd | tail -n -3) "
# setw -g window-status-current-format " #I:#{pane_current_path}:#{pane_current_command} "
setw -g window-status-current-format " #I:#{pane_current_command} "
setw -g window-status-current-bg black
setw -g window-status-current-fg blue
setw -g window-status-current-attr bright
setw -g window-status-last-bg white
setw -g window-status-last-fg blue
setw -g window-status-last-attr none
setw -g window-status-bg white
setw -g window-status-fg black
setw -g window-status-attr none

setw -g status-right "Copyright by Calvin"
setw -g status-right-bg white
setw -g status-right-fg red
setw -g status-right-attr bright

